Container adaptors
It is often useful to provide restricted interfaces to containers.
The library provides stack
, queue
and
priority_queue
through the adaptors that can work with
different sequence types.
Stack
Any container supporting the BackInsertContainer api interface
can be used to instantiate Stack api.
In particular, Vector api, List api and Deque api
can be used.
For example, new Stack(new Vector())
is a stack made out of
Vector
, and new Stack(new Deque())
is a
stack made out of Deque
.
Queue
Any container implementing the QueueContainer
interface
can be used to instantiate Queue api.
In particular, List api and Deque api can be used.
Priority queue
Any container with random access iterator and which implements the
BackInsertContainer api interface can be used to instantiate
PriorityQueue api.
In particular, Vector api and Deque api can be used.